Fix filled arcs and commit previous stuff which i somehow missed.
authorAlexander Larsson <alexl@src.gnome.org>
Tue, 28 Nov 2000 15:38:23 +0000 (15:38 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Tue, 28 Nov 2000 15:38:23 +0000 (15:38 +0000)
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/linux-fb/gdkprivate-fb.h
gdk/linux-fb/gdkwindow-fb.c
gdk/linux-fb/mifillarc.c

index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b1d302cbf49613ff1e39fc7c948b75ee12315d0c..9c7b93e2f3695115240def5269e80b20e5b667c9 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-28  Alexander Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/mifillarc.c (miFillArcSliceSetup):
+       The default mode in X is Pie Arcs, therefore that is
+       what Gtk+ uses.
+
 2000-11-28  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkinput-ps2.c:
index b8e1b78adbee5bfb00e6784454e569164f7faa90..a7761b1afee35b0fb69b0ae13cb3226ba397abbc 100644 (file)
@@ -110,7 +110,6 @@ struct _GdkWindowFBData
   GHashTable *properties;
 
   GdkEventMask event_mask;
-  gint level;
   gboolean realized : 1;
 };
 
index 728d17d1aee23ddbd817d3fb465b2d53aa16a7a5..30e822566c28d97cf8d437d950ba6ab5139ce0e0 100644 (file)
@@ -37,6 +37,7 @@
 static gpointer parent_class = NULL;
 
 static void recompute_drawable (GdkDrawable *drawable);
+static void gdk_fb_window_raise (GdkWindow *window);
 
 static void
 g_free_2nd (gpointer a, gpointer b, gpointer data)
@@ -234,7 +235,6 @@ gdk_window_new (GdkWindow     *parent,
     {
       depth = 0;
       private->input_only = TRUE;
-      impl->level = 10000;
       impl->drawable_data.colormap = NULL;
     }
 
@@ -246,13 +246,9 @@ gdk_window_new (GdkWindow     *parent,
   gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ?
                                  (attributes->cursor) :
                                  NULL));
-  
+
   if (parent_private)
-    {
-      parent_private->children = g_list_prepend (parent_private->children, window);
-      if (parent_private->children->next)
-       impl->level = GDK_WINDOW_FBDATA (GDK_WINDOW_P (parent_private->children->next->data)->impl)->level + 1;
-    }
+    parent_private->children = g_list_prepend (parent_private->children, window);
   
   return window;
 }
@@ -617,7 +613,8 @@ gdk_window_show (GdkWindow *window)
   if (!private->destroyed && !private->mapped)
     {
       private->mapped = TRUE;
-
+      gdk_fb_window_raise (window);
+      
       if (all_parents_shown ((GdkWindowObject *)private->parent))
        {
          GdkRectangle rect;
@@ -1071,37 +1068,39 @@ _gdk_windowing_window_clear_area_e (GdkWindow *window,
   _gdk_windowing_window_clear_area (window, x, y, width, height);
 }
 
-static gint
-compare_window_levels (gconstpointer a, gconstpointer b)
+static void
+gdk_fb_window_raise (GdkWindow *window)
 {
-  return (GDK_WINDOW_IMPL_FBDATA (b)->level - GDK_WINDOW_IMPL_FBDATA (a)->level);
+  GdkWindowObject *parent;
+
+  parent = GDK_WINDOW_OBJECT (window)->parent;
+
+  parent->children = g_list_remove (parent->children, window);
+  parent->children = g_list_prepend (parent->children, window);
 }
 
-/* Child list is sorted bottom-to-top */
 static void
-gdk_window_resort_children (GdkWindow *win)
+gdk_fb_window_lower (GdkWindow *window)
 {
-  GdkWindowObject *private = GDK_WINDOW_P(win);
+  GdkWindowObject *parent;
 
-  private->children = g_list_sort (private->children, compare_window_levels);
+  parent = GDK_WINDOW_OBJECT (window)->parent;
 
-  /* Now the fun part - redraw */
-  if (GDK_WINDOW_P (win)->parent)
-    {
-      gdk_window_invalidate_rect (win, NULL, TRUE);
-    }
+  parent->children = g_list_remove (parent->children, window);
+  parent->children = g_list_append (parent->children, window);
 }
 
+
 void
 gdk_window_raise (GdkWindow *window)
 {
   g_return_if_fail (window != NULL);
   g_return_if_fail (GDK_IS_WINDOW (window));
 
-  GDK_WINDOW_IMPL_FBDATA (window)->level++;
-
-  if (GDK_WINDOW_P (window)->parent)
-    gdk_window_resort_children ((GdkWindow *)GDK_WINDOW_P (window)->parent);
+  gdk_fb_window_raise (window);
+  
+  if (GDK_WINDOW_OBJECT (window)->parent)
+    gdk_window_invalidate_rect (window, NULL, TRUE);
 }
 
 void
@@ -1110,10 +1109,10 @@ gdk_window_lower (GdkWindow *window)
   g_return_if_fail (window != NULL);
   g_return_if_fail (GDK_IS_WINDOW (window));
   
-  GDK_WINDOW_IMPL_FBDATA (window)->level--;
-
-  if (GDK_WINDOW_P(window)->parent)
-    gdk_window_resort_children ((GdkWindow *)GDK_WINDOW_P (window)->parent);
+  gdk_fb_window_lower (window);
+  
+  if (GDK_WINDOW_OBJECT (window)->parent)
+    gdk_window_invalidate_rect (window, NULL, TRUE);
 }
 
 void
@@ -1151,7 +1150,26 @@ void
 gdk_window_set_transient_for (GdkWindow *window, 
                              GdkWindow *parent)
 {
-  GDK_WINDOW_IMPL_FBDATA (window)->level = GDK_WINDOW_IMPL_FBDATA (parent)->level + 1;
+  GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
+  GdkWindowObject *root = GDK_WINDOW_OBJECT (gdk_parent_root);
+  int i;
+  
+  g_return_if_fail (window != NULL);
+  g_return_if_fail (GDK_IS_WINDOW (window));
+  
+  g_return_if_fail (parent != NULL);
+  g_return_if_fail (GDK_IS_WINDOW (parent));
+  
+  g_return_if_fail (private->parent == gdk_parent_root);
+  g_return_if_fail (GDK_WINDOW_OBJECT (parent)->parent == gdk_parent_root);
+  
+  root->children = g_list_remove (root->children, window);
+
+  i = g_list_index (root->children, parent);
+  if (i<0)
+    root->children = g_list_prepend (root->children, window);
+  else 
+    root->children = g_list_insert (root->children, window, i);
 }
 
 void
index 31571c49943ca1e28b4a65cd3260fea238da36cb..9ebf6e5b2bc1119a1e2987a11850208cb77d2dde 100644 (file)
@@ -331,7 +331,7 @@ miFillArcSliceSetup(arc, slice, pGC)
     slice->max_bot_y = slice->max_top_y - 1;
     slice->flip_top = FALSE;
     slice->flip_bot = FALSE;
-    if (0 /* pGC->arcMode == ArcPieSlice */)
+    if (1 /* pGC->arcMode == ArcPieSlice */)
     {
        slice->edge1_top = (angle1 < HALFCIRCLE);
        slice->edge2_top = (angle2 <= HALFCIRCLE);